from wtforms import Form,StringField,EmailField,SubmitField
from wtforms.validators import DataRequired,Email,Length

class MyForm(FlaskForm):
    name=StringField('Name',validators=[DataRequired(),Length(min=1,max=50)])
    email=EmailField('Email',validators=[DataRequired(),Email()])
    submit=SubmitField('Submit')
#DataRequired():确保字段不为空
#Length(min=1,max=50)
#Email():验证字段是否为有效电子邮件地址

